//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CDrawCallsBatch.h>
///	@path	~/src/graphics/batch/
///	@date	2008/04/26
///	@desc	.

#pragma once

#include "xeres.h"

#include "graphics/IBatch.h"

namespace xeres {

	/*!	
		\class	CDrawCallsBatch
		\brief	Stores special draw calls for batching.
	*/
	class CDrawCallsBatch : public IBatch
	{
	public:

		/// \ctor
		CDrawCallsBatch( void );

		/// \dtor
		virtual ~CDrawCallsBatch( void );

		DECL_IOBJECT_CLASS_DYNAMIC( CDrawCallsBatch , IBatch );

	public:

		/// \impl	IBatch::BeginBatch
		virtual void BeginBatch( void );

		/// \impl	IBatch::EndBatch
		virtual void EndBatch( void );

		/// \impl IBatch::Render
		virtual void Render( RenderContext& rc );


		/// \brief	Add draw call.
		void AddDrawCall( const function<void(RenderContext&)>& dc );

	private:

		//@ data

		std::deque< function<void(RenderContext&)> >	m_drawCalls;
	};

} // namespace xeres
